import Vue from 'vue'
import Router from 'vue-router'

import HelloWorld from '@/components/HelloWorld'
// import HelloWorld from '@/views/register'

//安装路由
Vue.use(Router)
//配置导出路由
export default new Router({
  routes: [
    // {
    //   path: '/',
    //   component: resolve => require(['../index.vue'], resolve)
    // },
    // {
    //   //路由路径
    //   path: '/',
    //   //跳转组件
    //   name: 'HelloWorld',
    //   component: HelloWorld
    // },
    {
      path: '/register',
      component: resolve => require(['../views/register.vue'], resolve)
    }
    // {
    //   path: '/register',
    //   component: () => import('@/views/register'),
    //   hidden: true
    // }
  ]
})
// export const constantRoutes = [
//   {
//     path: '/register',
//     component: () => import('@/views/register'),
//     hidden: true
//   }
// ]

// export default new Router({
//   mode: 'history', // 去掉url中的#
//   scrollBehavior: () => ({ y: 0 }),
//   routes: constantRoutes
// })
